package com.chen.controller;

import com.chen.User;
import com.chen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("userById/{id}")
    public User userById(@PathVariable Integer id){
        return userService.userById(id);
    }

    @RequestMapping(value = "userId" ,method = RequestMethod.GET)
    public User userId( Integer id){
        return userService.userWen(id);
    }

    @RequestMapping(value = "users")
    public User userU(@RequestBody User user){
        return userService.userUser(user);
    }
}
